<div class="bd" id="newGame"></div>
<!-- Declare a JsRender template, in a script block: -->
<script id="gameTmp2" type="text/x-jsrender">
  {{for}}
  <a href="game.html?id={{:Id}}">
    <img
      data-src="{{:cover}}"
      src="{{:cover}}"
      lazy="loaded"
    />
    <span>{{:name}}</span>
  </a>
    {{/for}}
</script>

<script>
  $.ajax({
    url:
      "https://app.nocodb.com/api/v2/tables/mg01furv08tboqh/records?viewId=vwkcjs6aeek51qs1&limit=6&shuffle=1&offset=0" +
      window.gamelistParam,
    type: "GET",
    dataType: "json",
    headers: {
      "xc-token": "dePwLQ88UMbt4O9ndpBSQ-6RUC_nIhhpPea_0kTR",
    },
    contentType: "application/json; charset=utf-8",
    success: function (gameData) {
      // item Template
      let gameTmpl = $.templates("#gameTmp2");

      let gameHtml = gameTmpl.render(gameData.list.splice(0, 8));
      $("#newGame").html(gameHtml);
    },
    error: function (error) {
      console.error(error);
    },
  });
</script>
